home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / VS_804.ARJ / MAINTSRC.EXE / RPT_DBF.PRG < prev    next >
Text File  |  1991-10-25  |  3KB  |  121 lines

  1. * Filename......: Rpt_Dbf.Prg
  2. *
  3. * Author........: Vernon E. Six, Jr.
  4. *
  5. * Last Update...: Tue  10-15-1991  10:41:12
  6. *
  7. * Notice........: Copyright (c) 1991 by Vernon E. Six, Jr.
  8. *                 All Rights Reserved World Wide
  9. *
  10. * Dialect.......: Clipper v5.0x
  11.  
  12. #include "INKEY.CH"
  13. #include "SETCURS.CH"
  14.  
  15. FUNCTION Rpt_Dbf()
  16. *****
  17. * Print the current database structure, etc.
  18. *****
  19.  
  20.    *****
  21.    * Is the printer on?
  22.    *****
  23.    IF !ISPRINTER()
  24.       VS_Tell(3,0,"",PADC("Printer Not Ready!",40),"")
  25.       RETURN(NIL)
  26.    ENDIF
  27.  
  28.  
  29.    *****
  30.    * Let the user select the printer
  31.    *****
  32.    VS_Reset()
  33.  
  34.    VS_PrtMsg(2)
  35.  
  36.    *****
  37.    * Turn the printer on
  38.    *****
  39.    SET(_SET_CONSOLE,.F.)
  40.    SET(_SET_PRINTER,.T.)
  41.  
  42.    QQout( VS_Reset() + VS_CondOn() )
  43.  
  44.    *****
  45.    * Print database header info
  46.    *****
  47.    Qout( VS_Bold("Database Name: ") + _DICTHDR->DBF_NAME )
  48.    Qout( VS_Bold("  Description: ") + _DICTHDR->DESC     )
  49.    Qout( VS_Bold("     Recreate? ") + IF(_DICTHDR->CREATE, "Yes","No") )
  50.    Qout( VS_Bold("         Path: ") + _DICTHDR->PATH     )
  51.  
  52.  
  53.    *****
  54.    * Print the structure
  55.    *****
  56.    Qout( "" )
  57.    Qout( VS_Bold("### Field Name  Type  Len,Dec  Description          ") )
  58.    Qout( VS_Bold(REPLICATE("-",78) ) )
  59.  
  60.    _DICTFLD->( dbSeek( _DICTHDR->DBF_NAME ) )
  61.  
  62.    DO WHILE .NOT. _DICTFLD->( EOF() )
  63.  
  64.      IF _DICTFLD->DBF_NAME <> _DICTHDR->DBF_NAME
  65.         EXIT
  66.      ENDIF
  67.  
  68.       QOut( _DICTFLD->FIELD_NMBR + " " )
  69.      QQOut( _DICTFLD->FIELD_NAME + "    " )
  70.      QQOut( _DICTFLD->FIELD_TYPE + "   " )
  71.      QQOut( STRZERO(_DICTFLD->FIELD_LEN,3) + " " )
  72.      QQOut( STRZERO(_DICTFLD->FIELD_DEC,3) + "  " )
  73.      QQOut( _DICTFLD->DESC       + " " )
  74.  
  75.      _DICTFLD->( dbSkip() )
  76.  
  77.    ENDDO
  78.  
  79.  
  80.  
  81.    *****
  82.    * Print the index keys
  83.    *****
  84.    Qout( "" )
  85.    Qout( VS_Bold("##  FileName  Type  Key         ") )
  86.    Qout( VS_Bold(REPLICATE("-",78) ) )
  87.  
  88.    _DICTNTX->( dbSeek( _DICTHDR->DBF_NAME ) )
  89.  
  90.    DO WHILE .NOT. _DICTNTX->( EOF() )
  91.  
  92.      IF _DICTNTX->DBF_NAME <> _DICTHDR->DBF_NAME
  93.         EXIT
  94.      ENDIF
  95.  
  96.       QOut( _DICTNTX->ORDER + "  " )
  97.      QQOut( _DICTNTX->NTX_NAME + "    " )
  98.      QQOut( _DICTNTX->TYPE + "    " )
  99.      QQOut( LEFT(_DICTNTX->KEY,60) )
  100.  
  101.      _DICTNTX->( dbSkip() )
  102.  
  103.    ENDDO                            
  104.  
  105.  
  106.  
  107.    QQout( VS_FormFeed() )
  108.  
  109.    *****
  110.    * All Done!
  111.    *****
  112.    SET(_SET_CONSOLE,.T.)
  113.    SET(_SET_PRINTER,.F.)
  114.  
  115.    VS_EndText()
  116.  
  117. RETURN(NIL)
  118. *** EOF: Rpt_Dbf() **********************************************************
  119.  
  120.  
  121.